function addDefaultSignMember(){
	ajaxGetSignMembers();
	showContainer("SignMemberListDiv","MemberList_close");
}

function ajaxGetSignMembers(){
 	// Ajax GET  Roles 
	/*-------------function begin---------------------------*/	
	$.ajax({
			type: "post",
	    	dataType:"xml",
			"url" : "AjaxGetSignMembersServlet",
			//提交的数�
			data: {},
			beforeSend: function(XMLHttpRequest){
				$("#MemberListDiv").html("数据加载中……");
            },
            success: function(data, textStatus){
               createMemberList(data);
		    },
			complete: function(XMLHttpRequest, textStatus){
			},
			error: function(){
				
			}
	})
	/*-------------function end  ---------------------------*/
 }
 function hidenAddSignMember(){
    $("#MemberListDiv").html("");
 	hidenContainer("SignMemberListDiv");
 }
 function createMemberList(xmlData){
     createTableHead();
     loadMembers(xmlData);
 }
 function createTableHead(){
 	 $("#MemberListDiv").html("");
 	 $("#MemberListDiv").append(
 	 "<table  align='center' cellspacing='0' cellpadding='0' border='0' width='95%' >"
	 +"<tr>"
	 +  "<td width='5%' class='listTable_headTr'>&nbsp;</td>"
	 +	"<td width='30%' class='listTable_headTr'>用户名</td>"
	 +	"<td width='30%' class='listTable_headTr'>工号</td>"
	 +	"<td width='35%' class='listTable_headTr'>电子邮件</td>"
	 +"</tr>"
	 +"</table>");
 }

 function loadMembers(xmlData){
 	
	 var name       = "";
     var empNo      = "";
     var email  	= "";
     var memberId  	= "";
     $(xmlData).find("Member").each(function(index, element) {
        name       = $(this).children("name").text();
        empNo      = $(this).children("empNo").text();
        email 	   = $(this).children("email").text();
        memberId   = $(this).children("memberId").text();
        addTableTr(name,empNo,email,memberId);
     });
    
 }
 function addTableTr(name,empNo,email,memberId){
 	$("#MemberListDiv").append(
 	"<table  align='center' cellspacing='0' cellpadding='0' border='0' width='95%' >"
	 +"<tr>"
	+   "<td width='5%' class='listTable_tr'><input type='checkbox' value="+memberId+" name='memberID'/></td>"
	+   "<td width='30%' class='listTable_tr'>"+name+"</td>"
	+   "<td width='30%' class='listTable_tr'>"+empNo+"</td>"
	+   "<td width='35%' class='listTable_tr'>"+email+"</td>"
	+"</tr>"
	+"</table>");
 }
 function addMemberToDefaultsign(){
 	var memberIds = getMemberds("memberID");
 	if(memberIds.length == 0){
 		alert("请选择人员");
 		return;
 	}
 	document.getElementById("sign_memberIds").value = memberIds;
 	document.getElementById("addDefaultsignForm").submit();
 	hidenAddSignMember();
 }
 function getMemberds(tag_name){
 	var memberIds = document.getElementsByName(tag_name);
 	
 	var choose_Ids="";
 	for(i = 0; i < memberIds.length ; i++){
 		if(memberIds[i].checked){
 			choose_Ids =choose_Ids + memberIds[i].value + ",";
 		}
 	}
 	if(choose_Ids.length >0){
 		choose_Ids = choose_Ids.substr(0,choose_Ids.length-1);
 	}
 	
 	return choose_Ids;
 }
 
 function deleteDefaultSignMember(){
 	var memberIds = getMemberds("signMemberID");
 	if(memberIds.length == 0){
 		alert("请选择人员");
 		return;
 	}
 	document.getElementById("def_sign_memberIds").value = memberIds;
 	document.getElementById("DefaultsignManagerForm").submit();
 }
 